import React, { Component, useEffect, useMemo, useRef, useState } from "react";
import { View, Image, Text, Button } from "@tarojs/components";
import { EChart } from "echarts-taro3-react";
export function LeidaChart() {
  let refBarChart = useRef();
  useEffect(() => {
    if (refBarChart.current) {
      const option = {
        radar: {
          radius: "60%",
          name: {
            textStyle: {
              color: "#373737",
              borderRadius: 3,
              padding: [3, 5],
            },
          },

          indicator: [
            { name: "R-实际型", max: 6500 },
            { name: "I-研究型", max: 16000 },
            { name: "A-艺术型", max: 30000 },
            { name: "S-社会型", max: 38000 },
            { name: "E-企业型", max: 52000 },
            { name: "C-常规型", max: 25000 },
          ],
        },
        series: [
          {
            type: "radar",
            color: ["#EF4200"],
            data: [
              {
                value: [5000, 14000, 28000, 31000, 42000, 21000],
                name: "分数",
                areaStyle: {
                  color: "#FFB1B1",
                },
              },
            ],
          },
        ],
      };
      (refBarChart.current as any).refresh(option);
    }
  }, [refBarChart.current]);
  return (
    <View style={{ height: "500rpx", margin: "30rpx auto 0" }}>
      <EChart ref={refBarChart} canvasId="bar-canvas" />
    </View>
  );
}
